package org.dreamwork.jasmine2;

/**
 * Created by IntelliJ IDEA.
 * User: seth
 * Date: 2009-1-4
 * Time: 17:01:07
 */
public abstract class Constants {
    public static final int BUFFER_SIZE = 10240;

    public static final String TOMCAT_CONTEXT_CLASSPATH = "org.apache.catalina.jsp_classpath";
    public static final String SYSTEM_CLASSPATH = "java.class.path";
    public static final String WEBSPHERE_CONTEXT_CLASSPATH = "com.ibm.websphere.servlet.application.classpath";
    public static final String J2EE_TEMP_DIR = "javax.servlet.context.tempdir";

    public static final char[] ESCAPE = {
        '~', '`', '!', '@', '#', '%', '^', '&', '(', ')', '-', '+', '=', '|', '{', '}', '[', ']', ':', ';', '\'', '\'',
        '<', ',', '>', '?'
    };

    public static String escape (String str) {
        for (char escape : ESCAPE) {
            if (str.indexOf (escape) != -1) str = str.replace (escape, '_');
        }
        return str;
    }
}